/**
 * 
 */
package com.gaggle.dao;

import java.util.Collection;
import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.gaggle.domain.Student;

/**
 * @author rjaraja
 * 
 */
@Repository("studentDao")
@Transactional
public class StudentDaoImpl extends BaseDaoImpl<Student> implements StudentDao {

	@SuppressWarnings("unchecked")
	@Override
	public Collection<Student> findByName(String name) {
		if (name != null && !"".equals(name)) {
			return (List<Student>) getHibernateTemplate()
					.findByNamedQueryAndNamedParam(FIND_BY_NAME, "name", name);
		}
		return null;
	}

}
